package basic.reflect;

public enum Season {
	spring, summer, fall, winter;

	enum WeekDay {
		Mon("Monday"), Tue("Tuesday"), Wed("Wednesday"),
		Thu("Thursday"), Fri("Friday"), Sat("Saturday"),
		Sun("Sunday");
		private final String day;

		private WeekDay(String day) {
			this.day = day;
		}
		
		public String getDay() {
			return day;
		}

		public static void printDay(int i) {
			switch (i) {
			case 1:
				System.out.println(WeekDay.Mon);
				break;
			case 2:
				System.out.println(WeekDay.Tue);
				break;
			case 3:
				System.out.println(WeekDay.Wed);
				break;
			case 4:
				System.out.println(WeekDay.Thu);
				break;
			case 5:
				System.out.println(WeekDay.Fri);
				break;
			case 6:
				System.out.println(WeekDay.Sat);
				break;
			case 7:
				System.out.println(WeekDay.Sun);
				break;
			default:
				System.out.println("wrong day number!");
			}
		}
	}
	
	public static void print(int s,int w){
		switch (s) {
		case 1:
			System.out.print(Season.spring);
			break;
		case 2:
			System.out.print(Season.summer);
			break;
		case 3:
			System.out.print(Season.fall);
			break;
		case 4:
			System.out.print(Season.winter);
			break;
		default:
			System.out.print("wrong season number!");
		}
		System.out.print(",");
		switch (w) {
		case 1:
			System.out.print(WeekDay.Mon.getDay());
			break;
		case 2:
			System.out.print(WeekDay.Tue.getDay());
			break;
		case 3:
			System.out.print(WeekDay.Wed.getDay());
			break;
		case 4:
			System.out.print(WeekDay.Thu.getDay());
			break;
		case 5:
			System.out.print(WeekDay.Fri.getDay());
			break;
		case 6:
			System.out.print(WeekDay.Sat.day);
			break;
		case 7:
			System.out.print(WeekDay.Sun.day);
			break;
		default:
			System.out.print("wrong day number!");
		}
		System.out.println();
	}

	public static void main(String[] args) {
		for (Season s : Season.values()) {
			System.out.println(s);
		}
		for (WeekDay day : WeekDay.values()) {
			System.out.println(day);
		}
		WeekDay day = WeekDay.valueOf("Sun");
		System.out.println(day.getDay());
		WeekDay.printDay(5);
		
		print(2, 6);
		System.out.println(WeekDay.Fri.day);
	}
}
